package com.icinfo.cloud.provider.punish.fastcase.controller;

import com.icinfo.cloud.provider.punish.fastcase.service.IFastCaseDocumentRecordService;
import com.icinfo.cloud.provider.punish.ucase.casemain.vo.CaseStageLinkRelateDocumentVo;
import com.icinfo.cloud.provider.punish.ucase.punishinform.dto.FastCaseAddInfoDto;
import com.icinfo.framework.common.web.Result;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 简案快办文书控制器
 * @author shishengyao
 * @description
 * @date 2023/4/23
 */
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/punish/fast/case/document/record")
public class FastCaseDocumentRecordController {
    @Resource
    private IFastCaseDocumentRecordService fastCaseDocumentRecordService;

    /**
     * 【AJ-V1.1.1】描述： 获取简安快办告知合并生成的文书 （暂时没有用上，预留）
     *
     * @param caseId 用例id
     * @return {@link Result<List<CaseStageLinkRelateDocumentVo>> }
     * @author shishengyao
     * @date 2023/04/26
     */
    @GetMapping("/getFastCaseMergeDocumentBeforeInform")
    public Result<List<CaseStageLinkRelateDocumentVo>> changeToNormalProcedure(@RequestParam("caseId") String caseId) {
        return Result.success(fastCaseDocumentRecordService.getFastCaseMergeDocumentBeforeInform(caseId));
    }

    /**
     * 【AJ-V1.1.1】描述： 速结程序转普通程序
     *
     * @param caseId 用例id
     * @return {@link Result }
     * @author shishengyao
     * @date 2023/04/26
     */
    @GetMapping("/saveFastCaseRegisterDocument")
    public Result saveFastCaseRegisterDocument(@RequestParam("caseId") String caseId, FastCaseAddInfoDto fastCaseAddInfoDto) {
        return Result.success(fastCaseDocumentRecordService.saveFastCaseRegisterDocument(caseId,fastCaseAddInfoDto));
    }
}
